Repository navigation
Fix duplicate names for clashing top-level constants - #21
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
namify_commontracked used names in aName.context.Name.declarestrips trailing underscores, so after declaringinsert_the context still reportedinsert_as free, and two constants could get the same Python name. The laterdefthen silently shadowed the earlier one. This got much worse with 6162de2, but already happened for names that clash with reserved words or module names (e.g.sum_,iter_,Interval_).Symtab.set; drop the unused class/object namespaces.Quick_Test_Name_Clashas a regression test.test/test_unique_names.py(make test-names, part oftest-all): fails if any generated module binds a name twice. Before this fix it found 41 duplicates, e.g. inRecords,EnumandList.Quick, oracle, slow and names tests pass.
Fixes #20